
x = float(input())
y = 2 * x ** 3 + 3 * x ** 2 + 5 * x + 7
print(f"{y:.4f}")

x = float(input())
y = 2 * x**3 + 3 * x**2 + 5 * x + 7
print("{0:.4f}".format(y))
